package com.com.knowledgepaymentmanagementsystem.service.course.impl;

import com.com.knowledgepaymentmanagementsystem.mapper.course.PhotoMapper;
import com.com.knowledgepaymentmanagementsystem.pojo.course.Photo;
import com.com.knowledgepaymentmanagementsystem.service.course.PhotoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author 张攀
 * @version 1.0
 * @description: TODO
 * @date 2025/9/22 下午4:06
 */
@Service
public class PhotoServiceImpl implements PhotoService {

    @Autowired
    private PhotoMapper photoMapper;

    @Override
    public List<Photo> getPhoto(Photo photo) {
        return photoMapper.getPhoto(photo);
    }

    @Override
    public Object insertPhoto(Photo photo) {
        photo.setCreateTime(LocalDateTime.now());
        return photoMapper.insert(photo);
    }

    @Override
    public void updatePhoto(Photo photo) {
        photoMapper.updateById(photo);
    }

    @Override
    public void deletePhoto(Integer id) {
        photoMapper.deleteById(id);
    }
}
